#manual branding - file won't load
transcend_cols = c("#1A4C81","#59C3B4","#EF464B","#ADE0EE")
transcend_cols2 = c("#BC2582","#FFA630","#FFDE42","#99C24D","#218380","#D3B7D7")
transcend_grays = c("#4D4D4F","#9D9FA2","#D1D3D4")
transcend_na = transcend_grays[2]
theme_transcend = theme_gdocs(base_size = 14, base_family = "Open Sans") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
theme_set(theme_transcend)Check n’s**** as count and as percentage dropped and added core practices for multiple responder schools
time_tags <- full %>%
select(school_id, starts_with("time")) %>%
pivot_longer(cols = starts_with("time"),
names_to = "practice",
names_prefix = "time_",
values_to = "frequency") %>%
# mutate(frequency = case_when(frequency == 0 ~ "Not a core practice",
# frequency == 1 ~ "Less than a year",
# frequency == 2 ~ "1-2 years",
# frequency == 3 ~ "3-4 years",
# frequency == 4 ~ "5+ years",
# frequency == 5 ~ "Not sure")) %>%
group_by(practice, frequency) %>%
summarise(n = n())## # A tibble: 6 × 2
## # Groups: practice [6]
## practice n
## <chr> <int>
## 1 pbl 47
## 2 competency_education 37
## 3 accommodations 27
## 4 interdisciplinary 26
## 5 inclusion 24
## 6 community_partnerships 23
## # A tibble: 6 × 2
## # Groups: practice [6]
## practice n
## <chr> <int>
## 1 pbl 14
## 2 competency_education 12
## 3 mtss_academics 10
## 4 culturally_responsive 9
## 5 restorative 9
## 6 grading_mastery 7
## # A tibble: 6 × 2
## # Groups: practice [6]
## practice n
## <chr> <int>
## 1 competency_education 8
## 2 restorative 7
## 3 career_prep 6
## 4 mtss_academics 6
## 5 sel_integrated 6
## 6 assessments_deeper 4
time_tags %>%
filter(frequency == "Less than a year") %>%
select(c(1, 3)) %>%
arrange(desc(n)) %>%
head(10)## # A tibble: 10 × 2
## # Groups: practice [10]
## practice n
## <chr> <int>
## 1 competency_framework 2
## 2 inclusion 2
## 3 accommodations 1
## 4 adult_wellness 1
## 5 assessments_agency 1
## 6 assessments_deeper 1
## 7 career_prep 1
## 8 colead_family 1
## 9 competency_education 1
## 10 culturally_responsive 1
## # A tibble: 10 × 2
## # Groups: practice [10]
## practice n
## <chr> <int>
## 1 enriched_virtual 189
## 2 heritage 189
## 3 physical_well_being 189
## 4 assessments_bilingual 188
## 5 colead_industry 188
## 6 flipped_classroom 188
## 7 no_tracking 188
## 8 reallocation_resources 188
## 9 station_rotation 188
## 10 translanguaging 188
time_vars <- tags %>%
select(starts_with("time")) %>%
pivot_longer(cols = everything(),
names_to = "practice",
values_to = "frequency",
names_prefix = "time_") %>%
group_by(practice, frequency) %>%
summarise(count_tag = n())
# time_vars$frequency <- ifelse(is.na(time_vars$frequency), "Missing/Not Sure", time_vars$frequency)
time_vars <- time_vars %>%
pivot_wider(names_from = frequency,
values_from = count_tag) %>%
mutate(`Not sure`= ifelse(is.na(`Not sure`), 0, `Not sure`),
`Missing/Not Sure` = `NA` + `Not sure`) %>%
select(c(1, 6, 4, 5, 2, 8))time_vars %>%
arrange(-`5+ years`) %>%
head() %>%
ggplot(aes(x = reorder(practice, `5+ years`), y = `5+ years`)) +
geom_col(aes(fill = practice)) +
geom_text(aes(label = `5+ years`), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = "Top Practices",
title = "Practices Used Longest and Most Often") +
scale_fill_manual(values = c(transcend_cols2, transcend_na, transcend_cols[1])) +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)Restrict to variables needed.
dis_agg_time <- full %>%
select(school_id, contains("locale_"), starts_with("grades_"), school_type, starts_with("time_")) %>%
pivot_longer(cols = starts_with("time_"),
names_to = "practice",
names_prefix = "time_",
values_to = "frequency")school_type_tags <- dis_agg_time %>%
group_by(school_type, practice, frequency) %>%
summarise(n = n())pds_viz <- school_type_tags %>%
filter(frequency == "5+ years",
school_type == "Public district school") %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[1], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 25)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = "Top Practices",
title = "Public District Schools") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
pcs_viz <- school_type_tags %>%
filter(frequency == "5+ years",
school_type == "Public charter school") %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[2], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 25)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Public Charter Schools") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
ips_viz <- school_type_tags %>%
filter(frequency == "5+ years",
school_type == "Independent (private) school") %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[3], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 25)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Independent (Private) Schools") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)library(patchwork)
practices_descriptor_plot <- pds_viz + pcs_viz + ips_viz + plot_layout(ncol = 3) +
plot_annotation(title = "Practices Used Longest and Most Often - School Type",
theme = theme(plot.title = element_text(hjust = 0.5)))
practices_descriptor_plotschool_level_tags <- dis_agg_time %>%
select(school_id, practice, frequency, starts_with("grades_"), ) %>%
filter(frequency == "5+ years")prek_viz <- school_level_tags %>%
filter(grades_pk == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[1], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Pre-Kindergarten") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
elem_viz <- school_level_tags %>%
filter(grades_elementary == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[2], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Elementary School") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
middle_viz <- school_level_tags %>%
filter(grades_middle == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[3], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Middle School") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
high_viz <- school_level_tags %>%
filter(grades_high == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[4], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "High School") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)practices_levels_plot <- prek_viz + elem_viz + middle_viz + high_viz + plot_layout(ncol = 2) +
plot_annotation(title = "Practices Used Longest and Most Often - By the Levels Schools Offer",
theme = theme(plot.title = element_text(hjust = 0.5)))
practices_levels_plotschool_locale_tags <- dis_agg_time %>%
select(school_id, practice, frequency, contains("locale"), ) %>%
filter(frequency == "5+ years")rural_viz <- school_locale_tags %>%
filter(locale_rural == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[1], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Rural") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
urban_viz <- school_locale_tags %>%
filter(locale_urban == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[2], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Urban") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
suburban_viz <- school_locale_tags %>%
filter(locale_suburban == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[3], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Suburban") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)
multiple_locale_viz <- school_locale_tags %>%
filter(locale_multiple == 1) %>%
group_by(practice) %>%
summarise(n = n()) %>%
arrange(desc(n)) %>%
head(10) %>%
ggplot(aes(x = reorder(practice, n), y = n)) +
geom_col(fill = transcend_cols[4], position = "dodge") +
geom_text(aes(label = n), nudge_y = 0.5, hjust = 0, color = transcend_na, fontface = "bold", family = "sans") +
scale_y_continuous(limits = c(0, 40)) +
coord_flip() +
theme_bw() +
theme(legend.position = "none") +
labs(x = " ",
title = "Multiple Locales") +
theme(
plot.title = element_text(family = "Bebas Neue", color = "black"),
plot.background = element_blank(),
axis.text = element_text(colour = "black"),
axis.title = element_text(colour = "black"),
panel.border = element_rect(colour = "#4D4D4F"),
strip.text = element_text(size = rel(0.8)),
plot.margin = margin(10, 24, 10, 10, "pt")
)practices_locale_plot <- rural_viz + urban_viz + suburban_viz + multiple_locale_viz + plot_layout(ncol = 2) +
plot_annotation(title = "Practices Used Longest and Most Often - By School Locale",
theme = theme(plot.title = element_text(hjust = 0.5)))
practices_locale_plot